angular.module('app.routes', [])

    .config(function ($stateProvider, $urlRouterProvider) {

        // Ionic uses AngularUI Router which uses the concept of states
        // Learn more here: https://github.com/angular-ui/ui-router
        // Set up the various states which the app can be in.
        // Each state's controller can be found in controllers.js
        $stateProvider

            .state('tabs', {
                url: '/tabs',
                templateUrl: 'templates/tabsController.html',
                abstract: true
            })
            .state('tabs.home', {
                url: '/home',
                views: {
                    'homeView': {
                        templateUrl: 'templates/homePage.html',
                        controller: 'homeCtrl'
                    }
                }
            })
            .state('myHistory', {
                url: '/myHistory',
                templateUrl: 'templates/myHistoryPage.html'
            })
            .state('paiHangBang', {
                url: '/paiHangBang',
                templateUrl: 'templates/paiHangBangPage.html'
            })


            .state('tabs.jiaoyi', {
                url: '/jiaoyi',
                views: {
                    'jiaoyiView': {
                        templateUrl: 'templates/jiaoyiPage.html',
                        controller: 'jiaoyiCtrl'
                    }
                }
            })
            .state('wyjiaoyi', {
                url: '/wyjiaoyi',
                templateUrl: 'templates/wyjiaoyiPage.html',
                controller: 'wyjiaoyiCtrl'
            })
            .state('jiaoYiSuccess', {
                url: '/jiaoYiSuccess',
                templateUrl: 'templates/jiaoYiSuccessPage.html'
            })


            .state('tabs.pxbm', {
                url: '/pxbm',
                views: {
                    'pxbmView': {
                        templateUrl: 'templates/pxbmPage.html',
                        controller: 'pxbmCtrl'
                    }
                }
            })
            .state('touZiPeiXunDetail', {
                url: '/touZiPeiXunDetail',
                templateUrl: 'templates/touZiPeiXunDetailPage.html',
                controller: 'touZiPeiXunDetailCtrl'
            })
            .state('pay', {
                url: '/pay',
                templateUrl: 'templates/payPage.html',
                controller: 'payCtrl'
            })
            .state('tabs.person', {
                url: '/person',
                views: {
                    'personView': {
                        templateUrl: 'templates/personInfoPage.html',
                        controller: 'personCtrl'
                    }
                }
            })
            .state('chongZhi', {
                url: '/chongZhi',
                templateUrl: 'templates/chongZhiPage.html',
                controller: 'chongZhiCtrl'
            })
            .state('tiXian', {
                url: '/tiXian',
                templateUrl: 'templates/tiXianPage.html'
            })
            .state('caiWuMingXi', {
                url: '/caiWuMingXi',
                templateUrl: 'templates/caiWuMingXiPage.html'
            })
            .state('caiWuMingXiZhiChu', {
                url: '/caiWuMingXiZhiChu',
                templateUrl: 'templates/caiWuMingXiZhiChuPage.html'
            })
            .state('woDeKeCheng', {
                url: '/woDeKeCheng',
                templateUrl: 'templates/woDeKeChengPage.html'
            })
            .state('xiuGaiZiLiao', {
                url: '/xiuGaiZiLiao',
                templateUrl: 'templates/xiuGaiZiLiaoPage.html',
                controller:'xiuGaiZiLiaoCtrl'
            })
            .state('help', {
                url: '/help',
                templateUrl: 'templates/helpPage.html'
            })
            .state('useHelp', {
                url: '/useHelp',
                templateUrl: 'templates/useHelpPage.html'
            })
            .state('aboutUs', {
                url: '/aboutUs',
                templateUrl: 'templates/aboutUsPage.html'
            })
            .state('yiJianFanKui', {
                url: '/yiJianFanKui',
                templateUrl: 'templates/yiJianFanKuiPage.html'
            })
            .state('LianXiKeFu', {
                url: '/LianXiKeFu',
                templateUrl: 'templates/LianXiKeFuPage.html'
            })
            .state('setAcc', {
                url: '/setAcc',
                templateUrl: 'templates/setAccPage.html'
            })
            .state('bindAcc', {
                url: '/bindAcc',
                templateUrl: 'templates/bindAccPage.html'
            })
            .state('editPwd', {
                url: '/editPwd',
                templateUrl: 'templates/editPwdPage.html'
            })
            //.state('shareFriend', {
            //    url: '/shareFriend',
            //    templateUrl: 'templates/shareFriendPage.html'
            //})
            .state('myCard', {
                url: '/myCard',
                templateUrl: 'templates/myCardPage.html'
            })
            .state('addCard', {
                url: '/addCard',
                templateUrl: 'templates/addCardPage.html'
            })
            .state('bankList', {
                url: '/bankList',
                templateUrl: 'templates/bankListPage.html'
            })




            .state('welcome', {
                url: '/welcome',
                templateUrl: 'templates/welcomePage.html',
                controller: 'welComeCtrl'
            })
            .state('login', {
                url: '/login',
                templateUrl: 'templates/loginPage.html',
                controller: 'loginCtrl'
            })
            .state('zhuce', {
                url: '/zhuce',
                templateUrl: 'templates/zhucePage.html',
                controller: 'zhuceCtrl'
            })

        $urlRouterProvider.otherwise('/welcome')


    });